<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试HTML页面</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            color: #333;
        }
        h1 {
            color: #348cf8;
            border-bottom: 1px solid #eee;
            padding-bottom: 10px;
        }
        .params-container {
            background-color: #f8f9fa;
            padding: 15px;
            border-radius: 5px;
            margin: 20px 0;
        }
        .param-item {
            padding: 8px 0;
            border-bottom: 1px solid #eee;
        }
        .param-item:last-child {
            border-bottom: none;
        }
        .param-name {
            font-weight: 600;
            color: #495057;
        }
        .back-button {
            display: inline-block;
            padding: 10px 20px;
            background-color: #6c757d;
            color: white;
            text-decoration: none;
            border-radius: 5px;
            margin-top: 20px;
        }
        .back-button:hover {
            background-color: #5a6268;
        }
    </style>
</head>
<body>
    <h1>这是一个集成在Vue项目中的HTML页面</h1>
    <p>此页面演示了从Vue组件跳转到HTML页面并传递参数的功能。</p>
    
    <div class="params-container">
        <h3>接收到的参数：</h3>
        <div id="params-display"></div>
    </div>
    
    <a href="javascript:history.back()" class="back-button">返回上一页</a>
    
    <script>
        // 解析URL参数的函数
        function getURLParams() {
            const params = {};
            const queryString = window.location.search.substring(1);
            const pairs = queryString.split('&');
            
            for (let i = 0; i < pairs.length; i++) {
                const pair = pairs[i].split('=');
                const key = decodeURIComponent(pair[0]);
                const value = decodeURIComponent(pair[1] || '');
                params[key] = value;
            }
            
            return params;
        }
        
        // 显示接收到的参数
        function displayParams() {
            const params = getURLParams();
            const paramsDisplay = document.getElementById('params-display');
            
            if (Object.keys(params).length === 0) {
                paramsDisplay.innerHTML = '<p>没有接收到参数</p>';
                return;
            }
            
            let html = '';
            for (const [key, value] of Object.entries(params)) {
                html += `<div class="param-item"><span class="param-name">${key}:</span> ${value}</div>`;
            }
            
            paramsDisplay.innerHTML = html;
        }
        
        // 页面加载时执行
        window.onload = displayParams;
    </script>
</body>
</html>